package 行为型模型.模板方法模式;

public class Client {
    public static void main(String[] args) {
        GouZi g=new A();
        g.handle();


        GouZi g1=new GouZi() {
            @Override
            protected void control() {
                System.out.println("存钱");
            }
        };
        g1.handle();
    }
}

class A extends GouZi{

    @Override
    protected void control() {
        System.out.println("取钱");
    }
}
